
// <copyright file="IConcurrentStore.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The ConcurrentStore interface.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Collections.Concurrent
{
    using System;

    /// <summary>
    /// The ConcurrentStore interface.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    public interface IConcurrentStore<T> : IDisposable
    {
        #region Public Events

        /// <summary>
        /// The on store flush.
        /// </summary>
        event EventHandler<StoreFlushEventArgs<T>> OnStoreFlush;

        #endregion Public Events

        #region Public Properties

        /// <summary>
        /// Gets the max wait time.
        /// </summary>
        long MaxWaitTime { get; }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The add.
        /// </summary>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool Add(T item);

        /// <summary>
        /// The force flush.
        /// </summary>
        void ForceFlush();

        #endregion Public Methods and Operators
    }
}